/**
 * 后端接口权限校验
 */
module.exports = async (ctx, next) => {
  const matchResult = await ctx.service.systemUser.verifyAuth(ctx.state.admin, ctx.method, ctx.path)

  if (!matchResult) throw '非法操作'

  await next()
}
